export function setCookie(key:string, value:any, expiredays:number):any {
  var exdate = new Date();
  exdate.setDate(exdate.getDate() + expiredays);
 return  document.cookie =
    key + "=" + escape(value) + (expiredays == null ? "" : ";expires=" + exdate.toString());
}

export function getCookie(name:string):any {
  var arr,
    reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
  if ((arr = document.cookie.match(reg))) {
    return arr[2];
  } else {
    return null;
  }
}

export function delCookie(name:any) {
  setCookie(name, "", -1)
}
